<template>
	<view style="padding: 20rpx;">
		<navigator url="/pages/APIpages/LogPage/LogPage"><button>打印日志</button></navigator>
		<navigator url="/pages/APIpages/TimerPage/TimerPage" open-type="switchTab"><button>计时器</button></navigator>
		<navigator url="/pages/APIpages/StoragePage/StoragePage"><button>数据缓存</button></navigator>
		<navigator url="/pages/APIpages/RouterPage/RouterPage"><button>路由与页面跳转</button></navigator>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onLoad() {
			uni.preloadPage({
				url:"/pages/APIpages/StoragePage/StoragePage"
			})
			    //uni.preloadPage    预加载页面，使得页面打开速度加快
		},
		methods: {
			goStoPage(){
				uni.navigateTo({
					url:"/pages/APIpages/StoragePage/StoragePage",
					success() {
						console.log("navigateTo--->success");
					},
					fail(e) {
						console.log("navigateTo--->fail: "+JSON.stringify(e));
					},
					complete() {
						console.log("navigateTo--->complete");
					}
				})
				//uni.navigateTo   保留当前页面，跳转到应用内的某个页面
				
				// uni.redirectTo({
				// 	url:"/pages/APIpages/StoragePage/StoragePage"
				// })
				//uni.redirectTo  关闭当前页面，跳转到应用内的某个页面
				
				// uni.switchTab({
				// 	url:"/pages/tabBar/tabcompage/tabcompage"
				// })
				//跳转到tabBar页面，并关闭其他所有非tabBar页面
			}

		}
	}
</script>

<style>
	button {
		margin: 20rpx;
	}
</style>